import type { VxeGridProps } from '#/adapter/vxe-table';

import { renderDictTag } from '#/utils/render';

import { OperationPermissionsEnum } from './dict';

export const columns: VxeGridProps['columns'] = [
  {
    field: 'topic',
    title: 'Topic',
    treeNode: true,
  },
  {
    field: 'topicSourceType',
    title: '操作权限',
    slots: {
      default: ({ row }) => {
        return renderDictTag(
          `${row.topicSourceType}`,
          OperationPermissionsEnum,
        );
      },
    },
  },
  {
    field: 'topicDesc',
    title: '描述',
    resizable: false,
  },
];
